/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  @endpointMap = {
    ap-southeast-1 = 'sls.ap-southeast-1.aliyuncs.com',
    cn-hangzhou = 'sls.cn-hangzhou.aliyuncs.com',
    cn-hongkong = 'sls.cn-hongkong.aliyuncs.com',
    cn-huhehaote = 'sls.cn-huhehaote.aliyuncs.com',
    cn-shanghai = 'sls.cn-shanghai.aliyuncs.com',
    cn-shenzhen = 'sls.cn-shenzhen.aliyuncs.com',
    cn-zhangjiakou = 'sls.cn-zhangjiakou.aliyuncs.com',
    eu-central-1 = 'sls.eu-central-1.aliyuncs.com',
  };
  checkConfig(config);
  @endpoint = getEndpoint('sls', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model AnalyzeAppLogRequest {
  appType?: string(name='AppType'),
  displayName?: string(name='DisplayName'),
  variableMap?: map[string]any(name='VariableMap'),
}

model AnalyzeAppLogShrinkRequest {
  appType?: string(name='AppType'),
  displayName?: string(name='DisplayName'),
  variableMapShrink?: string(name='VariableMap'),
}

model AnalyzeAppLogResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model AnalyzeAppLogResponse = {
  headers: map[string]string(name='headers'),
  body: AnalyzeAppLogResponseBody(name='body'),
}

async function analyzeAppLogWithOptions(tmpReq: AnalyzeAppLogRequest, runtime: Util.RuntimeOptions): AnalyzeAppLogResponse {
  Util.validateModel(tmpReq);
  var request = new AnalyzeAppLogShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.variableMap)) {
    request.variableMapShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.variableMap, 'VariableMap', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AnalyzeAppLog', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function analyzeAppLog(request: AnalyzeAppLogRequest): AnalyzeAppLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return analyzeAppLogWithOptions(request, runtime);
}

model AnalyzeProductLogRequest {
  clientIp?: string(name='ClientIp'),
  cloudProduct?: string(name='CloudProduct'),
  hotTTL?: int32(name='HotTTL'),
  lang?: string(name='Lang'),
  logstore?: string(name='Logstore'),
  overwrite?: boolean(name='Overwrite'),
  project?: string(name='Project'),
  region?: string(name='Region'),
  resourceQuota?: string(name='ResourceQuota'),
  TTL?: int32(name='TTL'),
  variableMap?: map[string]any(name='VariableMap'),
}

model AnalyzeProductLogShrinkRequest {
  clientIp?: string(name='ClientIp'),
  cloudProduct?: string(name='CloudProduct'),
  hotTTL?: int32(name='HotTTL'),
  lang?: string(name='Lang'),
  logstore?: string(name='Logstore'),
  overwrite?: boolean(name='Overwrite'),
  project?: string(name='Project'),
  region?: string(name='Region'),
  resourceQuota?: string(name='ResourceQuota'),
  TTL?: int32(name='TTL'),
  variableMapShrink?: string(name='VariableMap'),
}

model AnalyzeProductLogResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model AnalyzeProductLogResponse = {
  headers: map[string]string(name='headers'),
  body: AnalyzeProductLogResponseBody(name='body'),
}

async function analyzeProductLogWithOptions(tmpReq: AnalyzeProductLogRequest, runtime: Util.RuntimeOptions): AnalyzeProductLogResponse {
  Util.validateModel(tmpReq);
  var request = new AnalyzeProductLogShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.variableMap)) {
    request.variableMapShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.variableMap, 'VariableMap', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AnalyzeProductLog', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function analyzeProductLog(request: AnalyzeProductLogRequest): AnalyzeProductLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return analyzeProductLogWithOptions(request, runtime);
}

model CheckResourceOrchestrationRequest {
  assetsId?: string(name='AssetsId'),
  language?: string(name='Language'),
  operationPolicy?: string(name='OperationPolicy'),
}

model CheckResourceOrchestrationResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CheckResourceOrchestrationResponse = {
  headers: map[string]string(name='headers'),
  body: CheckResourceOrchestrationResponseBody(name='body'),
}

async function checkResourceOrchestrationWithOptions(request: CheckResourceOrchestrationRequest, runtime: Util.RuntimeOptions): CheckResourceOrchestrationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CheckResourceOrchestration', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkResourceOrchestration(request: CheckResourceOrchestrationRequest): CheckResourceOrchestrationResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkResourceOrchestrationWithOptions(request, runtime);
}

model CreateAppRequest {
  appName?: string(name='AppName'),
  clientIp?: string(name='ClientIp'),
  clientToken?: string(name='ClientToken'),
  config?: string(name='Config'),
  displayName?: string(name='DisplayName'),
}

model CreateAppResponseBody = {
  appName?: string(name='AppName'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model CreateAppResponse = {
  headers: map[string]string(name='headers'),
  body: CreateAppResponseBody(name='body'),
}

async function createAppWithOptions(request: CreateAppRequest, runtime: Util.RuntimeOptions): CreateAppResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateApp', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppWithOptions(request, runtime);
}

model CreateImportIngestionJobRequest {
  args?: string(name='Args'),
  callerId?: string(name='CallerId'),
  completions?: int32(name='Completions'),
  envFromSecret?: string(name='EnvFromSecret'),
  envVars?: string(name='EnvVars'),
  image?: string(name='Image'),
  imagePullSecret?: string(name='ImagePullSecret'),
  jobName?: string(name='JobName'),
  namespace?: string(name='Namespace'),
  parallelism?: int32(name='Parallelism'),
  region?: string(name='Region'),
  restartPolicy?: string(name='RestartPolicy'),
}

model CreateImportIngestionJobResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateImportIngestionJobResponse = {
  headers: map[string]string(name='headers'),
  body: CreateImportIngestionJobResponseBody(name='body'),
}

async function createImportIngestionJobWithOptions(request: CreateImportIngestionJobRequest, runtime: Util.RuntimeOptions): CreateImportIngestionJobResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateImportIngestionJob', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createImportIngestionJob(request: CreateImportIngestionJobRequest): CreateImportIngestionJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createImportIngestionJobWithOptions(request, runtime);
}

model CreateIngestionJobRequest {
  args?: string(name='Args'),
  callerId?: string(name='CallerId'),
  completions?: int32(name='Completions'),
  envFromSecret?: string(name='EnvFromSecret'),
  envVars?: string(name='EnvVars'),
  image?: string(name='Image'),
  imagePullSecret?: string(name='ImagePullSecret'),
  jobName?: string(name='JobName'),
  namespace?: string(name='Namespace'),
  parallelism?: int32(name='Parallelism'),
  region?: string(name='Region'),
  restartPolicy?: string(name='RestartPolicy'),
}

model CreateIngestionJobResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateIngestionJobResponse = {
  headers: map[string]string(name='headers'),
  body: CreateIngestionJobResponseBody(name='body'),
}

async function createIngestionJobWithOptions(request: CreateIngestionJobRequest, runtime: Util.RuntimeOptions): CreateIngestionJobResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateIngestionJob', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createIngestionJob(request: CreateIngestionJobRequest): CreateIngestionJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIngestionJobWithOptions(request, runtime);
}

model CreateResourceOrchestrationRequest {
  assetsId?: string(name='AssetsId'),
  language?: string(name='Language'),
  operationPolicy?: string(name='OperationPolicy'),
  tokens?: string(name='Tokens'),
}

model CreateResourceOrchestrationResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateResourceOrchestrationResponse = {
  headers: map[string]string(name='headers'),
  body: CreateResourceOrchestrationResponseBody(name='body'),
}

async function createResourceOrchestrationWithOptions(request: CreateResourceOrchestrationRequest, runtime: Util.RuntimeOptions): CreateResourceOrchestrationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateResourceOrchestration', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createResourceOrchestration(request: CreateResourceOrchestrationRequest): CreateResourceOrchestrationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createResourceOrchestrationWithOptions(request, runtime);
}

model DeleteAppRequest {
  appName?: string(name='AppName'),
  clientIp?: string(name='ClientIp'),
}

model DeleteAppResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model DeleteAppResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteAppResponseBody(name='body'),
}

async function deleteAppWithOptions(request: DeleteAppRequest, runtime: Util.RuntimeOptions): DeleteAppResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteApp', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteApp(request: DeleteAppRequest): DeleteAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppWithOptions(request, runtime);
}

model DeleteImportIngestionJobRequest {
  jobName?: string(name='JobName'),
  namespace?: string(name='Namespace'),
  region?: string(name='Region'),
}

model DeleteImportIngestionJobResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteImportIngestionJobResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteImportIngestionJobResponseBody(name='body'),
}

async function deleteImportIngestionJobWithOptions(request: DeleteImportIngestionJobRequest, runtime: Util.RuntimeOptions): DeleteImportIngestionJobResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteImportIngestionJob', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteImportIngestionJob(request: DeleteImportIngestionJobRequest): DeleteImportIngestionJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteImportIngestionJobWithOptions(request, runtime);
}

model DeleteIngestionJobRequest {
  jobName?: string(name='JobName'),
  namespace?: string(name='Namespace'),
  region?: string(name='Region'),
}

model DeleteIngestionJobResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteIngestionJobResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteIngestionJobResponseBody(name='body'),
}

async function deleteIngestionJobWithOptions(request: DeleteIngestionJobRequest, runtime: Util.RuntimeOptions): DeleteIngestionJobResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteIngestionJob', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteIngestionJob(request: DeleteIngestionJobRequest): DeleteIngestionJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIngestionJobWithOptions(request, runtime);
}

model DescribeAppRequest {
  appName?: string(name='AppName'),
  clientIp?: string(name='ClientIp'),
}

model DescribeAppResponseBody = {
  appModel?: {
    appName?: string(name='AppName'),
    config?: string(name='Config'),
    displayName?: string(name='DisplayName'),
    uid?: long(name='Uid'),
  }(name='AppModel'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model DescribeAppResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeAppResponseBody(name='body'),
}

async function describeAppWithOptions(request: DescribeAppRequest, runtime: Util.RuntimeOptions): DescribeAppResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeApp', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeApp(request: DescribeAppRequest): DescribeAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppWithOptions(request, runtime);
}

model DisableAlertRequest {
  alertId?: string(name='AlertId'),
  app?: string(name='App'),
  endpoint?: string(name='Endpoint'),
  projectName?: string(name='ProjectName'),
}

model DisableAlertResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableAlertResponse = {
  headers: map[string]string(name='headers'),
  body: DisableAlertResponseBody(name='body'),
}

async function disableAlertWithOptions(request: DisableAlertRequest, runtime: Util.RuntimeOptions): DisableAlertResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DisableAlert', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function disableAlert(request: DisableAlertRequest): DisableAlertResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableAlertWithOptions(request, runtime);
}

model EnableAlertRequest {
  alertId?: string(name='AlertId'),
  app?: string(name='App'),
  endpoint?: string(name='Endpoint'),
  language?: string(name='Language'),
  projectName?: string(name='ProjectName'),
  region?: string(name='Region'),
  ruleId?: string(name='RuleId'),
  ruleVersion?: string(name='RuleVersion'),
  tokens?: string(name='Tokens'),
}

model EnableAlertResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableAlertResponse = {
  headers: map[string]string(name='headers'),
  body: EnableAlertResponseBody(name='body'),
}

async function enableAlertWithOptions(request: EnableAlertRequest, runtime: Util.RuntimeOptions): EnableAlertResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('EnableAlert', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function enableAlert(request: EnableAlertRequest): EnableAlertResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableAlertWithOptions(request, runtime);
}

model GetAlertRequest {
  alertId?: string(name='AlertId'),
  app?: string(name='App'),
  endpoint?: string(name='Endpoint'),
  projectName?: string(name='ProjectName'),
}

model GetAlertResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetAlertResponse = {
  headers: map[string]string(name='headers'),
  body: GetAlertResponseBody(name='body'),
}

async function getAlertWithOptions(request: GetAlertRequest, runtime: Util.RuntimeOptions): GetAlertResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetAlert', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getAlert(request: GetAlertRequest): GetAlertResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAlertWithOptions(request, runtime);
}

model GetAlertHistoriesRequest {
  alertId?: string(name='AlertId'),
  app?: string(name='App'),
  endpoint?: string(name='Endpoint'),
  fromTs?: int32(name='FromTs'),
  line?: int32(name='Line'),
  offset?: int32(name='Offset'),
  projectName?: string(name='ProjectName'),
  region?: string(name='Region'),
  toTs?: int32(name='ToTs'),
}

model GetAlertHistoriesResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetAlertHistoriesResponse = {
  headers: map[string]string(name='headers'),
  body: GetAlertHistoriesResponseBody(name='body'),
}

async function getAlertHistoriesWithOptions(request: GetAlertHistoriesRequest, runtime: Util.RuntimeOptions): GetAlertHistoriesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetAlertHistories', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getAlertHistories(request: GetAlertHistoriesRequest): GetAlertHistoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAlertHistoriesWithOptions(request, runtime);
}

model GetSlsServiceResponseBody = {
  code?: string(name='Code'),
  enabled?: boolean(name='Enabled'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
  success?: boolean(name='Success'),
}

model GetSlsServiceResponse = {
  headers: map[string]string(name='headers'),
  body: GetSlsServiceResponseBody(name='body'),
}

async function getSlsServiceWithOptions(runtime: Util.RuntimeOptions): GetSlsServiceResponse {
  var req = new OpenApi.OpenApiRequest{};
  return doRPCRequest('GetSlsService', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getSlsService(): GetSlsServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSlsServiceWithOptions(runtime);
}

model InitProjectAlertResourceRequest {
  projectName?: string(name='ProjectName'),
  region?: string(name='Region'),
}

model InitProjectAlertResourceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model InitProjectAlertResourceResponse = {
  headers: map[string]string(name='headers'),
  body: InitProjectAlertResourceResponseBody(name='body'),
}

async function initProjectAlertResourceWithOptions(request: InitProjectAlertResourceRequest, runtime: Util.RuntimeOptions): InitProjectAlertResourceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('InitProjectAlertResource', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function initProjectAlertResource(request: InitProjectAlertResourceRequest): InitProjectAlertResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return initProjectAlertResourceWithOptions(request, runtime);
}

model InitUserAlertResourceRequest {
  app?: string(name='App'),
  language?: string(name='Language'),
  region?: string(name='Region'),
}

model InitUserAlertResourceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model InitUserAlertResourceResponse = {
  headers: map[string]string(name='headers'),
  body: InitUserAlertResourceResponseBody(name='body'),
}

async function initUserAlertResourceWithOptions(request: InitUserAlertResourceRequest, runtime: Util.RuntimeOptions): InitUserAlertResourceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('InitUserAlertResource', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function initUserAlertResource(request: InitUserAlertResourceRequest): InitUserAlertResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return initUserAlertResourceWithOptions(request, runtime);
}

model OpenSlsServiceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model OpenSlsServiceResponse = {
  headers: map[string]string(name='headers'),
  body: OpenSlsServiceResponseBody(name='body'),
}

async function openSlsServiceWithOptions(runtime: Util.RuntimeOptions): OpenSlsServiceResponse {
  var req = new OpenApi.OpenApiRequest{};
  return doRPCRequest('OpenSlsService', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function openSlsService(): OpenSlsServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openSlsServiceWithOptions(runtime);
}

model QuerySafServiceRequest {
  paramType?: string(name='ParamType'),
  paramValue?: string(name='ParamValue'),
  projectName?: string(name='ProjectName'),
}

model QuerySafServiceResponseBody = {
  code?: string(name='Code'),
  ext?: map[string]any(name='Ext'),
  requestId?: string(name='RequestId'),
  score?: string(name='Score'),
}

model QuerySafServiceResponse = {
  headers: map[string]string(name='headers'),
  body: QuerySafServiceResponseBody(name='body'),
}

async function querySafServiceWithOptions(request: QuerySafServiceRequest, runtime: Util.RuntimeOptions): QuerySafServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QuerySafService', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function querySafService(request: QuerySafServiceRequest): QuerySafServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySafServiceWithOptions(request, runtime);
}

model SetAlertActionPolicyRequest {
  app?: string(name='App'),
  policy?: string(name='Policy'),
  policyId?: string(name='PolicyId'),
  policyName?: string(name='PolicyName'),
}

model SetAlertActionPolicyResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SetAlertActionPolicyResponse = {
  headers: map[string]string(name='headers'),
  body: SetAlertActionPolicyResponseBody(name='body'),
}

async function setAlertActionPolicyWithOptions(request: SetAlertActionPolicyRequest, runtime: Util.RuntimeOptions): SetAlertActionPolicyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SetAlertActionPolicy', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function setAlertActionPolicy(request: SetAlertActionPolicyRequest): SetAlertActionPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAlertActionPolicyWithOptions(request, runtime);
}

model SetAlertCenterResourceRequest {
  app?: string(name='App'),
  language?: string(name='Language'),
  region?: string(name='Region'),
}

model SetAlertCenterResourceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SetAlertCenterResourceResponse = {
  headers: map[string]string(name='headers'),
  body: SetAlertCenterResourceResponseBody(name='body'),
}

async function setAlertCenterResourceWithOptions(request: SetAlertCenterResourceRequest, runtime: Util.RuntimeOptions): SetAlertCenterResourceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SetAlertCenterResource', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function setAlertCenterResource(request: SetAlertCenterResourceRequest): SetAlertCenterResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAlertCenterResourceWithOptions(request, runtime);
}

model SetAlertCenterResourceByConsoleRequest {
  app?: string(name='App'),
  language?: string(name='Language'),
  region?: string(name='Region'),
}

model SetAlertCenterResourceByConsoleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SetAlertCenterResourceByConsoleResponse = {
  headers: map[string]string(name='headers'),
  body: SetAlertCenterResourceByConsoleResponseBody(name='body'),
}

async function setAlertCenterResourceByConsoleWithOptions(request: SetAlertCenterResourceByConsoleRequest, runtime: Util.RuntimeOptions): SetAlertCenterResourceByConsoleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SetAlertCenterResourceByConsole', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function setAlertCenterResourceByConsole(request: SetAlertCenterResourceByConsoleRequest): SetAlertCenterResourceByConsoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAlertCenterResourceByConsoleWithOptions(request, runtime);
}

model SyncAlertGroupsRequest {
  app?: string(name='App'),
  groups?: string(name='Groups'),
}

model SyncAlertGroupsResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SyncAlertGroupsResponse = {
  headers: map[string]string(name='headers'),
  body: SyncAlertGroupsResponseBody(name='body'),
}

async function syncAlertGroupsWithOptions(request: SyncAlertGroupsRequest, runtime: Util.RuntimeOptions): SyncAlertGroupsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SyncAlertGroups', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function syncAlertGroups(request: SyncAlertGroupsRequest): SyncAlertGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return syncAlertGroupsWithOptions(request, runtime);
}

model SyncAlertUsersRequest {
  app?: string(name='App'),
  users?: string(name='Users'),
}

model SyncAlertUsersResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SyncAlertUsersResponse = {
  headers: map[string]string(name='headers'),
  body: SyncAlertUsersResponseBody(name='body'),
}

async function syncAlertUsersWithOptions(request: SyncAlertUsersRequest, runtime: Util.RuntimeOptions): SyncAlertUsersResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SyncAlertUsers', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function syncAlertUsers(request: SyncAlertUsersRequest): SyncAlertUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return syncAlertUsersWithOptions(request, runtime);
}

model UpdateAppRequest {
  appName?: string(name='AppName'),
  clientIp?: string(name='ClientIp'),
  config?: string(name='Config'),
  displayName?: string(name='DisplayName'),
}

model UpdateAppResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model UpdateAppResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateAppResponseBody(name='body'),
}

async function updateAppWithOptions(request: UpdateAppRequest, runtime: Util.RuntimeOptions): UpdateAppResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateApp', '2019-10-23', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateApp(request: UpdateAppRequest): UpdateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAppWithOptions(request, runtime);
}

